package com.wanmait.recycle.util;

public class PageContext {

    // 定义threadLocal变量：pageNum
    private static ThreadLocal<Integer> local = new ThreadLocal<Integer>();    // 保存第几页
    public static int getPageNum() {
        Integer pageNum = local.get();
        if (pageNum == null) {
            return 1;
        }
        return pageNum;
    }
    public static void setPageNum(int pageNum) {
        local.set(pageNum);
    }
    public static void removePageNum() {
        local.remove();
    }

}
